package 通用路径写法.Test02;

import java.io.IOException;
import java.io.InputStream;

public class Test02 {
    public static void main(String[] args) {
        //返回一个流
        InputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream("IO流/myFile2");//没有出错

        try {
            byte[] bytes = new byte[in.available()];
            in.read(bytes);
            System.out.println(new String(bytes));
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
